<%@page import="facebook.Utilities"%>
<% if (session.getAttribute("userid") != null) {%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style type="text/css">
             #summation {
                font-size: 18px;
                font-weight: bold;
            }
            
            .txt {
                font-weight: bold;
                text-align: right;
            }
            
            
        </style>
           
       
        <%@ include file="/style/styles.html" %>
        <%@ include file="/js/libraries.html" %>   
        <title>Ricarica credito</title>
        <script src="jquery-somma.js"></script>
              <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>

    </head>
    <body onload="init();initRicarica();">
        <div id="wrapper">
            <%@ include file="/header.jsp" %>
            <div id="body">
             <div id="second_half">
                    <img src="../images/credit2.jpg" width="200" height="400" style="margin-top:50px;"/>   
                </div> 
                <div id="first_half"> 
                    <br />
                    <section>
                    <form id=payment action="/delo-war/IMDSponsoredEvent.jsp">
                        <fieldset style="width: 500px;">
                            <legend>Dati anagrafici</legend>
                            <ol>
                                <li>
                                    <label for=name>Nome</label>
                                        
                                    <input id=name name=name type=text placeholder="Nome e Cognome" value="" required autofocus />
                                </li>
                                <li>
                                    <label for=email>E-mail</label>
                                    <input id=email name=email type=email placeholder="esempio@dominio.com" value="" required />
                                </li>
                                <li>
                                    <label for=phone>Telefono</label>
                                    <input cols=50 id=phone name=phone type=tel placeholder="Eg. +39011235666" value=""required />
                                </li>
                            </ol>
                        </fieldset>
                        <fieldset style="width: 500px;">
                            <legend>Indirizzo di spedizione fattura</legend>
                            <ol>
                                <li>
                                    <label for=address>Indirizzo</label>
                                    <textarea cols=50 id=address name=address rows=5 value="Address"required>
                                    </textarea>
                                </li>
                                <li>
                                    <label for=postcode>Codice Postale</label>
                                    <input id=postcode name=postcode type=text value="10010"required />
                                        
                                </li>
                                <li>
                                    <label for=country>Paese</label>
                                    <input id=country name=country type=text value="Italy"required />
                                </li>
                            </ol>
                        </fieldset>
                        <fieldset style="width: 500px;">
                            <legend>Dettagli carta di credito</legend>
                            <table border="0">
                            
                            <tr> 
                                <td width="450px" style="vertical-align:top;"> 
                               
                                <ol>
                                    <li>
                                        <fieldset>
                                            <legend>Tipo Carta</legend>
                                            <ol>
                                                <li>
                                                    <input id=visa name=cardtype type=radio checked ="cheked" />
                                                    <label for=visa>VISA</label>
                                                </li>
                                                <li>
                                                    <input id=amex name=cardtype type=radio />
                                                    <label for=amex>Mastercard</label>
                                                </li>
                                                <li>
                                                    <input id=mastercard name=cardtype type=radio />
                                                    <label for=mastercard>American Express</label>
                                                </li>
                                            </ol>
                                        </fieldset>
                                    </li>
                                    <li>
                                        <label for=cardnumber>Numero Carta (16 cifre)</label>
                                        <input id=cardnumber name=cardnumber type=text value="1987 4323 5423 5466" required />
                                    </li>
                                    <li>
                                        <label for=secure>Codice di sicurezza</label>
                                        <input id=secure name=secure type=number value="321" required />
                                    </li>
                                    <li>
                                        <label for=namecard>Nome sulla carta</label>
                                        <input id=namecard name=namecard type=text placeholder="" value="Name" required />
                                    </li>
                                </ol>       
                            </td> 
                           
                        </tr>
                                    
                                <%
                                    String val = request.getParameter("impressions_number");
                                    int impression = Integer.parseInt(val);
                                    double importo = impression;
                                    importo = importo * 0.01;
                                        
                                %>
                                    
                                    
                            </table>  
                                
                        </fieldset>
                      
                
                
                </div>
                
<p class="clear"></p>

               
                <div id="separatore"></div>
                <p class="clear"></p>
        <section>
                        <b>Importo da pagare: Euro <%=importo%></b>
                        <input type="hidden" name="money" value="<%=impression%>"/>
                        <input type="hidden" name="action" value="recharge"/>
                        <br /><br />
                        <button type=submit>Procedi con l'acquisto</button>      
                    </form>
                </section>
                   
           


                <br /> 
            </div>


            <div id="footer">
                unito.it - DIPARTIMENTO DI INFORMATICA (Facolt&agrave; di Scienze M.F.N.) - C.so Svizzera 185, Torino
            </div>

        </div>

    </body>
</html>
<% } else
        response.sendRedirect(Utilities.getBaseUrl(request));
%>
    
